package com.syj.collect.base;

import android.os.Build;
import android.os.Bundle;

import androidx.annotation.RequiresApi;


public abstract class BaseMvpAvtivity<V,P extends BasePresent<V>>  extends BaseActivity{
    protected   P presenter;

    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        presenter=initPresenter();
        presenter.attach((V) this);
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        presenter.detach();
    }

    public abstract P initPresenter();
}
